﻿namespace TwiMixer.RESTAPI
{
    using System.Configuration;
    using TwiMixer.RESTAPI.Sina;
    using Twitterizer;

    public static class APIProviderFactory
    {
        public static IRESTAPI GetApiProvider(APIProviderEnum api)
        {
            OAuthTokens token = new OAuthTokens();
            Utility.LoadProviderConfig(ref token, api);

            switch (api)
            {
                case APIProviderEnum.twimixer:
                    break;
                case APIProviderEnum.tweet:
                //TwitterRESTAPI twitter=
                //    new TwitterRESTAPI(token,ConfigurationManager.AppSettings["TwiMixer_Host"]+"user/token/callback.aspx?api=tweet");
                //return twitter;
                case APIProviderEnum.sina:
                    SinaRESTAPI sina =
                        new SinaRESTAPI(token, ConfigurationManager.AppSettings["TwiMixer_Host"] + "user/token/callback.aspx?api=sina");
                    return sina;
                case APIProviderEnum.tencent:
                    break;
                default:
                    //throw;
                    break;
            }
            return null;
        }
    }
}